# Contributor: Thomas Kienlen <kommander@laposte.net>
# Maintainer: Thomas Kienlen <kommander@laposte.net>
pkgname=tuxpaint
pkgver=0.9.34
pkgrel=0
pkgdesc="Drawing program designed for young children"
# useless on s390x
arch="all !s390x"
url="https://tuxpaint.org/"
license="GPL-2.0-or-later"
depends="
	hicolor-icon-theme
	xdg-utils
	"
makedepends="
	gperf
	imagemagick
	libimagequant-dev
	libpaper-dev
	librsvg-dev
	sdl2-dev
	sdl2_gfx-dev
	sdl2_image-dev
	sdl2_mixer-dev
	sdl2_pango-dev
	sdl2_ttf-dev
	"
subpackages="$pkgname-doc $pkgname-lang"
source="$pkgname-$pkgver.tar.gz::https://sourceforge.net/projects/tuxpaint/files/tuxpaint/$pkgver/tuxpaint-$pkgver.tar.gz/download"
options="!check" # no test suite

prepare() {
	default_prepare

	# Set fullscreen native resolution by default
	sed -i \
		-e 's/# fullscreen=.*/fullscreen=yes/' \
		-e 's/# native=.*/native=yes/' \
		src/tuxpaint.conf
}

build() {
	make -j1 \
		CFLAGS="$CFLAGS $(pkg-config --cflags pango) -D_POSIX_PRIORITY_SCHEDULING -Wno-implicit-function-declaration" \
		PREFIX=/usr
}

package() {
	make -j1 \
		PREFIX=/usr \
		GNOME_PREFIX=/usr \
		X11_ICON_PREFIX="$pkgdir"/usr/share/pixmaps \
		DESTDIR="$pkgdir" \
		install

	install -Dm644 src/$pkgname.desktop \
		"$pkgdir"/usr/share/applications/$pkgname.desktop
}

sha512sums="
acc31be12609edd36ea584396ddf3d39ead06ae0a7fed57db779c77fee886e8db788bd7201276da85499d116bb224387468f46cf1775834757dd022729dc7b55  tuxpaint-0.9.34.tar.gz
"
